# coding:utf-8

class RET:
    OK = "200"
    DBERR = "4001"
    NODATA = "4002"
    DATAEXIST = "4003"
    DATAERR = "4004"
    SESSIONERR = "4101"
    LOGINERR = "4102"
    PARAMERR = "4103"
    USERERR = "4104"
    ROLEERR = "4105"
    PWDERR = "4106"
    REQERR = "4201"
    IPERR = "4202"
    THIRDERR = "4301"
    IOERR = "4302"
    SERVERERR = "4500"
    UNKOWNERR = "4501"
    NOT_TOKEN = "4600"
    TOKEN_FAILUER = "4601"
    TOKEN_ERROR = "4602"
    TIME_FORMAT_ERROR = "4700"
    MONEY_ERROR = "4701"
    TYPE_ID_ERROR = "4702"
    ADD_ERROR = "4800"
    DEL_ERROR = '4801'
    IMAGE_ERROR = '4802'
    NEWS_ERROR = "4710"
    COLLECT_ERROR = "4711"
    ATTENTION_ERROR = "4712"
    UNFOLLOW = "4603"
    CREATE_LABEL_OK = '4604'
    CREATE_TOPIC_OK = '4605'
    CAN_NOT_YOURSELF = '4606'
    CLOCK_ERROR = '4606'


error_map = {
    RET.OK: u"成功",
    RET.DBERR: u"数据库查询错误",
    RET.NODATA: u"无数据",
    RET.DATAEXIST: u"数据已存在",
    RET.DATAERR: u"数据错误",
    RET.SESSIONERR: u"用户未登录",
    RET.LOGINERR: u"用户登录失败",
    RET.PARAMERR: u"参数错误",
    RET.USERERR: u"用户不存在或未激活",
    RET.ROLEERR: u"用户身份错误",
    RET.PWDERR: u"密码错误",
    RET.REQERR: u"非法请求或请求次数受限",
    RET.IPERR: u"IP受限",
    RET.THIRDERR: u"第三方系统错误",
    RET.IOERR: u"文件读写错误",
    RET.SERVERERR: u"内部错误",
    RET.UNKOWNERR: u"未知错误",
    RET.NOT_TOKEN: u"没有携带token值",
    RET.TOKEN_FAILUER: u"token失效,请重新登录",
    RET.TOKEN_ERROR: u"token错误",
    RET.TIME_FORMAT_ERROR: u"时间格式错误",
    RET.MONEY_ERROR: u"金额设置错误",
    RET.TYPE_ID_ERROR: u"收入支出类型错误",
    RET.ADD_ERROR: u"添加失败",
    RET.DEL_ERROR: u"移除失败",
    RET.IMAGE_ERROR: u"图片格式错误",
    RET.NEWS_ERROR: u'该动态消息不存在',
    RET.COLLECT_ERROR: u"该收藏已存在",
    RET.UNFOLLOW: u"取消关注",
    RET.CREATE_LABEL_OK: u"新增标签成功",
    RET.CREATE_TOPIC_OK: u"新增话题成功",
    RET.ATTENTION_ERROR: u"该用户暂未有关注对象",
    RET.CAN_NOT_YOURSELF: u"不能关注自己哦",
    RET.CLOCK_ERROR: u'打卡错误'
}
